import java_cup.runtime.Scanner;
import java_cup.runtime.Symbol;
import ast.sym;

class Myparser extends parser {

	String filename;

	Myparser(Scanner s, String f) {
		super(s);
		filename = f;
	}

	public void syntax_error(Symbol cur_token) {
		if (cur_token.sym == sym.EOF)
			System.out.println("Syntax error: unexpected end of file");
		else {
			System.out.println("File \"" + filename + "\"" + ", line "
					+ cur_token.left + ", character " + cur_token.right + ":");
			System.out.println("syntax error");
		}
		System.exit(1);
	}
}
